<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function jsj(cc){
				let b1=document.getElementById("a1").value
				let b2=document.getElementById("a2").value
				let b3=eval(b1+cc+b2)
				if(isNaN(b3)||!isFinite(b3)){
					document.getElementById("a3").value="只能输入数字"
					return;
				}
				document.getElementById("a3").value=b3.toFixed(15)-0
			}
		</script>
	</head>
	<body>
		第一个数:
		<input type="text" id="a1" value="" />
		<br>
		第二个数:
		<input type="text" id="a2" value=""/>
		<br>
		<button onclick="jsj('+')">+</button>
		<button onclick="jsj('-')">-</button>
		<button onclick="jsj('*')">*</button>
		<button onclick="jsj('/')">/</button>
		<br>
		计算结果:
		<input type="text" id="a3" value=""/>
	</body>
</html>
